#include"VPE.h"

//TODO:考虑是否要加入读取VIEU的控制指令，来决定实际的VPE执行逻辑？
// std::vector<double>* VPE::Execute() {
//     //!res指针应在VPU中将其值赋给整体的寄存器后，由VPU中的caller负责将其delete
//     std::vector<double>* res = new std::vector<double>(2);
//     res->push_back(vmac_1->Execute());
//     res->push_back(vmac_2->Execute());
//     res->push_back(vmac_3->Execute());
//     //res->push_back(vieu);
//     return res;
// }

write_req_info_reg  VPE::Execute_VMAC1(instruction* vmac_instr) {
    this->vmac_1->Execute(vmac_instr);
    return this->vmac_1->upload_write_msg();
}

write_req_info_reg  VPE::Execute_VMAC2(instruction* vmac_instr) {
    this->vmac_2->Execute(vmac_instr);
    return this->vmac_2->upload_write_msg();
}

write_req_info_reg  VPE::Execute_VMAC3(instruction* vmac_instr) {
    this->vmac_3->Execute(vmac_instr);
    return this->vmac_3->upload_write_msg();
}

write_req_info_reg  VPE::Execute_VIEU(instruction* vieu_instr) {
    this->vmac_3->Execute(vieu_instr);
    return this->vmac_3->upload_write_msg();
}

void VPE::input_distribution() {

}